<template>
	<view>
<!-- 		<view class="tixian-s">
			<view>提现到：</view>
			<view class="tixian-wx">
				<picker class="tixian-ri" @change="bindPickerChange" :value="index" :range="array">
						<view class="uni-input"><view>{{array[index]}}</view><image class="next-icon" style="width:30upx" src="/static/other/next.png" mode="widthFix"></image></view>
				</picker>
			</view>
		</view> -->
		<view class="tixian-price">
			<view class="tixian-input">
				<view>商家姓名：</view>
				<input type="text"  v-model="zhanghao" placeholder="商家姓名" placeholder-style="font-size:30upx;color:#999">
			</view>
			<view class="tixian-input">
				<view>商家手机号：</view>
				<input type="text"  v-model="zhanghao" placeholder="商家手机号" placeholder-style="font-size:30upx;color:#999">
			</view>
			<view class="tixian-input" >
				<view>会员姓名：</view>
				<input type="text" v-model="truename" placeholder="输入会员姓名" placeholder-style="font-size:30upx;color:#999">
			</view>
			<view class="tixian-input">
				<view>会员手机号：</view>
				<input type="text"  v-model="zhanghao" placeholder="输入会员手机号" placeholder-style="font-size:30upx;color:#999">
			</view>

			<view class="tixian-input">
				<view>价格 ：</view>
				<input type="number" v-model="price" placeholder="价格" placeholder-style="font-size:30upx;color:#999">
			</view>
			<view class="tixian-input">
			<view>支付方式：</view>
			<view class="tixian-wx">
				<picker class="tixian-ri" @change="bindPickerChange" :value="index" :range="array">
						<view class="uni-input"><view>{{array[index]}}</view><image class="next-icon" style="width:30upx" src="/static/other/next.png" mode="widthFix"></image></view>
				</picker>
				<!-- <view>微信钱包</view>
				<image src="/static/other/wechat.png"></image> -->
			</view>
			</view>
			<view class="tixian-tip">
				<view class="tx-tip">可用余额￥{{allpric}}</view>
				<!-- <view class="tx-all" @click="alltx">全部提现</view> -->
			</view>
		</view>
		<!-- <view class="tx-jl" @click="tixianr">提现记录</view> -->
		<view class="tx-btn" @click="cash">报单</view>
	</view>
</template>

<script>
	import api from "../../common/fxb.js"
	export default {
		data() {
			return {
				price:'', //输入金额
				allpric:0 , //可提现金额
				array: ["在线支付","余额"],
				index:0,
				data:0,
				zhanghao:'',
				truename:'',
			};
		},
		onLoad() {
			uni.setNavigationBarTitle({
				title: '商家报单'
			});
			this.getdata();
		},
		methods:{
			alltx:function(){
				this.price = this.allpric
			},
			cash:function(){

				if(this.zhanghao==''&&this.index==1){
					uni.showToast({
						title:"请输入支付宝账户",
						icon:'none'
					})
					return false 
				}
				if(this.truename==''&&this.index==1){
					uni.showToast({
						title:"请输入支付宝真实姓名",
						icon:'none'
					}) 
					return false 
				}
				var that = this;
				api.ApiGet({
					op:'post',
					do:'tixian',
					money:that.price,
					zhanghao:that.zhanghao,
					truename:that.truename,
					type:that.index,
				},function(res){ 
					uni.showToast({
						title:res.data.datas,
						icon:'none'
					})
					that.getdata();
				})
				
			},
			getdata:function(){
				var that = this;
				api.ApiGet({
					op:'',
					do:'tixian',
				},function(res){ 
					that.allpric = res.data.datas.user_info.money;
				})
			},
			tixianr:function(){
				uni.navigateTo({
					url:'/pagesA/tixian-record/tixian-record'
				})
			},
			bindPickerChange: function(e) {
					console.log('picker发送选择改变，携带值为', e.target.value)
					this.index = e.target.value
			},
		}
		
	}
</script>

<style lang="scss">
		page{background-color: $uni-bg;}
		.tixian-s{
			display: flex;
			justify-content: space-between;
			align-items: center;
			width: 690upx;
			padding: 30upx;
			margin-top: 25upx;
			background-color: #fff;
			font-size: 30upx;
			color: #333;
			.tixian-wx{
				display: flex;
				width: 500upx;
				justify-content: flex-end;
				margin-left: 50upx;
				.tixian-ri{
					
					display: flex;
					justify-content: flex-end;
					float: left;
				}
				view{
					float: left;
					font-size: 28upx;
					color: #999;
				}
				image{
					width: 40upx;
					height: 40upx;
					margin-left: 12upx;
				}
				
			}
		}
		.uni-input{
			display: flex;
			align-items: center; 
		}
		.next-icon{
			width: 20upx; 
		}
		.tixian-price{
			width: 990upx;
			padding: 24upx 30upx;
			background-color: #fff;
			margin-top: 30upx;
			.tixian-tit{
				margin-bottom: 15upx;
				font-size: 30upx;
				color: #333;
			}
			.tixian-input{
				display: flex;
				align-items: center;
				padding: 8upx 0;
				border-bottom: 1upx solid #EBEBEB;
				view{
					font-size: 30upx;
					color: #333;
					width: 180upx;
				}
				input{
					margin-left: 50upx;
					font-size: 60upx;
					color: #FE6806;
				}
			}
			.tixian-tip{
				display: flex;
				margin-top: 18upx;
				font-size: 28upx;
				color: #8c8c8c;
				.tx-all{
					margin-left: 30upx;
					color: #007AFF;
				}
			}
		}
		.tx-jl{
			width: 690upx;
			padding:20upx 30upx;
			font-size: 30rpx;
			color:#FE6806 ;
			text-align: right;
		}
		.tx-btn{
			width: 500upx;
			height: 88upx;
			margin: 80upx 135upx;
			background: linear-gradient(90deg,#FF9C27,#FD6913);
			box-shadow: 0 0 16upx rgba($color: #FF9C27, $alpha: .4);
			border-radius: 80upx;
			font-size: 30upx;
			color: #fff;
			text-align: center;
			line-height: 88upx;
		}
</style>
